package com.xunchi.haichuan.data.service;

import java.io.File;
import java.util.Date;
import java.util.List;

import com.xunchi.haichuan.data.model.Data;

/**
 * 作者：kongxb<br>
 * 模块名称：数据管理模块<br>
 * 功能描述：数据服务接口<br>
 * 维护记录：2009.11.27, kongxb 创建该接口
 */
public interface DataService {

	/**
	 * 获取最新数据
	 * 
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<Data> getLatestDatas(int start, int limit) throws Exception;

	/**
	 * 搜索数据
	 * 
	 * @param province
	 * @param city
	 * @param validation
	 * @param beginDate
	 * @param endDate
	 * @return
	 * @throws Exception
	 */
	public List<Data> search(String province, String city, int validation, Date beginDate, Date endDate)
			throws Exception;

	/**
	 * 搜索数据
	 * 
	 * @param province
	 * @param city
	 * @param validation
	 * @param beginDate
	 * @param endDate
	 * @param count
	 * @return
	 * @throws Exception
	 */
	public List<Data> search(String province, String city, int validation, Date beginDate, Date endDate, int count)
			throws Exception;

	/**
	 * 搜索数据
	 * 
	 * @param province
	 * @param city
	 * @param validation
	 * @param beginDate
	 * @param endDate
	 * @param start
	 * @param limit
	 * @return
	 * @throws Exception
	 */
	public List<Data> search(String province, String city, int validation, Date beginDate, Date endDate, int start,
			int limit) throws Exception;

	/**
	 * 搜索数据
	 * 
	 * @param province
	 * @param city
	 * @param validation
	 * @param beginDate
	 * @param endDate
	 * @param count
	 * @param start
	 * @param limit
	 * @return
	 * @throws Exception
	 */
	public List<Data> search(String province, String city, int validation, Date beginDate, Date endDate, int count,
			int start, int limit) throws Exception;

	/**
	 * 获取列表总数
	 * 
	 * @return
	 */
	public int getTotalCount();

	/**
	 * 获取数据
	 * 
	 * @param dataId
	 * @return
	 * @throws Exception
	 */
	public Data getDataById(String dataId) throws Exception;

	/**
	 * 按照提交时间将数据List逆序排序
	 * 
	 * @param dataList
	 */
	public void sortDataList(List<Data> dataList);

	/**
	 * 从.xls文件导入
	 * 
	 * @param file
	 * @return
	 * @throws Exception
	 */
	public boolean importFromExcelFile(File file) throws Exception;

	/**
	 * 导出到.xls文件
	 * 
	 * @param dataList
	 * @return
	 * @throws Exception
	 */
	public File exportToExcelFile(List<Data> dataList) throws Exception;

}
